package org.red_cross_service.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.red_cross_service.domain.Duration;
import org.red_cross_service.mapper.DurationMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DurationService {

    @Autowired
    private DurationMapper durationMapper;


    public Duration getDuration() {
        return durationMapper.selectOne(new QueryWrapper<>());
    }

    public String setDuration(Duration duration) {
        return durationMapper.updateById(duration.setId(1)) > 0 ? "success" : "fail";
    }
}
